package com.jobson.model;

// Generated May 1, 2013 12:14:36 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 * Stock generated by hbm2java
 */
@Entity
@Table(name = "Stock", catalog = "JobsonTally")
public class Stock implements java.io.Serializable
{

   /**
	 * 
	 */
	private static final long serialVersionUID = -4744966585998830243L;
private Long id;
   private User userByModifiedBy;
   private User userByCreatedBy;
   private PhoneNo phoneNo;
   private Integer quantity;
   private Double pricePerUnit;
   private Double priceTotal;
   private Integer purchaseDate;
   private Date createdOn;
   private Date modifiedOn;
   private boolean isPublic;
   private boolean isEmpty;
   private boolean isDeleted;
   private int tableId;
   
   // Flag indicate if update has to be called for Customer Table table 
   private boolean isUpdated = false;
   
   public void setIsUpdated(boolean aValue) {
	   this.isUpdated = aValue;
}
   
   @Transient
   public boolean getIsUpdated(){
	   return isUpdated;
   }

   public Stock()
   {this.tableId = 10;
   }

   public Stock(boolean isPublic, boolean isEmpty, boolean isDeleted, int tableId)
   {
      this.isPublic = isPublic;
      this.isEmpty = isEmpty;
      this.isDeleted = isDeleted;
      this.tableId = tableId;
   }

   public Stock(User userByModifiedBy, User userByCreatedBy, PhoneNo phoneNo, Integer quantity, Double pricePerUnit, Double priceTotal, Integer purchaseDate, Date createdOn, Date modifiedOn, boolean isPublic, boolean isEmpty, boolean isDeleted, int tableId)
   {
      this.userByModifiedBy = userByModifiedBy;
      this.userByCreatedBy = userByCreatedBy;
      this.phoneNo = phoneNo;
      this.quantity = quantity;
      this.pricePerUnit = pricePerUnit;
      this.priceTotal = priceTotal;
      this.purchaseDate = purchaseDate;
      this.createdOn = createdOn;
      this.modifiedOn = modifiedOn;
      this.isPublic = isPublic;
      this.isEmpty = isEmpty;
      this.isDeleted = isDeleted;
      this.tableId = tableId;
   }

   @Id
   @GeneratedValue(strategy = IDENTITY)
   @Column(name = "ID", unique = true, nullable = false)
   public Long getId()
   {
      return this.id;
   }

   public void setId(Long id)
   {
      this.id = id;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "ModifiedBy")
   public User getUserByModifiedBy()
   {
      return this.userByModifiedBy;
   }

   public void setUserByModifiedBy(User userByModifiedBy)
   {
      this.userByModifiedBy = userByModifiedBy;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "CreatedBy")
   public User getUserByCreatedBy()
   {
      return this.userByCreatedBy;
   }

   public void setUserByCreatedBy(User userByCreatedBy)
   {
      this.userByCreatedBy = userByCreatedBy;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "ProductID")
   public PhoneNo getPhoneNo()
   {
      return this.phoneNo;
   }

   public void setPhoneNo(PhoneNo phoneNo)
   {
      this.phoneNo = phoneNo;
   }

   @Column(name = "Quantity")
   public Integer getQuantity()
   {
      return this.quantity;
   }

   public void setQuantity(Integer quantity)
   {
      this.quantity = quantity;
   }

   @Column(name = "PricePerUnit", precision = 22, scale = 0)
   public Double getPricePerUnit()
   {
      return this.pricePerUnit;
   }

   public void setPricePerUnit(Double pricePerUnit)
   {
      this.pricePerUnit = pricePerUnit;
   }

   @Column(name = "PriceTotal", precision = 22, scale = 0)
   public Double getPriceTotal()
   {
      return this.priceTotal;
   }

   public void setPriceTotal(Double priceTotal)
   {
      this.priceTotal = priceTotal;
   }

   @Column(name = "PurchaseDate")
   public Integer getPurchaseDate()
   {
      return this.purchaseDate;
   }

   public void setPurchaseDate(Integer purchaseDate)
   {
      this.purchaseDate = purchaseDate;
   }

   @Temporal(TemporalType.DATE)
   @Column(name = "CreatedOn", length = 10)
   public Date getCreatedOn()
   {
      return this.createdOn;
   }

   public void setCreatedOn(Date createdOn)
   {
      this.createdOn = createdOn;
   }

   @Temporal(TemporalType.DATE)
   @Column(name = "ModifiedOn", length = 10)
   public Date getModifiedOn()
   {
      return this.modifiedOn;
   }

   public void setModifiedOn(Date modifiedOn)
   {
      this.modifiedOn = modifiedOn;
   }

   @Column(name = "IsPublic", nullable = false)
   public boolean isIsPublic()
   {
      return this.isPublic;
   }

   public void setIsPublic(boolean isPublic)
   {
      this.isPublic = isPublic;
   }

   @Column(name = "IsEmpty", nullable = false)
   public boolean isIsEmpty()
   {
      return this.isEmpty;
   }

   public void setIsEmpty(boolean isEmpty)
   {
      this.isEmpty = isEmpty;
   }

   @Column(name = "IsDeleted", nullable = false)
   public boolean isIsDeleted()
   {
      return this.isDeleted;
   }

   public void setIsDeleted(boolean isDeleted)
   {
      this.isDeleted = isDeleted;
   }

   @Column(name = "TableID", nullable = false)
   public int getTableId()
   {
      return this.tableId;
   }

   public void setTableId(int tableId)
   {
      this.tableId = tableId;
   }

}
